<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <base href="<%=basePath%>">

    <title>管理用户</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
    <LINK rel=stylesheet type=text/css href="css/login.css">

    <script type="text/javascript">
        function check()
        {
            var name=document.getElementById('username').value;//用户名
            var passwd=document.getElementById('password').value;//密码
            if(name==""||passwd=="")
            {
                alert('用户名或密码不能为空');
                myform.username.focus();
            }else
            {
                myform.submit();
            }
        }

    </script>
</head>

<body bgcolor="#eff2f7">

<%
    String username = "";
    String passwd = "";
    Cookie[] cookies = request.getCookies();

    if(cookies!=null)
    {
        for (Cookie cookie : cookies)
        {
            if ("username".equals(cookie.getName()))
            {
                username=cookie.getValue();
            }
            if("password".equals(cookie.getName()))
            {
                passwd=cookie.getValue();
            }
        }
    }
%>
<DIV class=login>
    <P class=pl></P>
    <DIV class=l></DIV>
    <DIV class=c>
        <FORM id="myform" name="form1" action="/ODSManager/user_Logintst" method="post" onsubmit="return check();" >
            <DIV class=to>
                <SPAN class=tol><A class=v target=_blank></A></SPAN>
                <SPAN class=tor></SPAN>
            </DIV>
            <DIV class=in>
                <DL>
                    <DT>用户名:</DT>
                    <DD>
                        <INPUT style="WIDTH: 150px" type="text" id="username" name="user.userName"
                               value="<%out.print(username);%>">
                    </DD>
                    <DD class=e></DD>
                </DL>
                <DL>
                    <DT>密&nbsp;&nbsp;&nbsp;&nbsp;码:</DT>
                    <DD>
                        <INPUT style="WIDTH: 150px" id="password" type="password" name="user.userPassword"
                               value="<%out.print(passwd);%>">
                    </DD>
                    <DD class=e></DD>
                </DL>
                <DL>
                    <DD>
                    <DT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</DT>
                    <input type="checkbox" value="keep" name="iskeepinfo"><DT1>自动登录</DT1>

                    </DD>
                 </DL>
            </DIV>
            <DIV class=su>
                <SPAN><INPUT type="button" value="" onclick="check();"></SPAN>
            </DIV>
        </FORM>
    </DIV>

    <DIV class=r></DIV>
    <P class=pr></P>
</DIV>
<div class=r>

    <%
        String errorinfo = (String) request.getSession().getAttribute("error");
        String overtime  = (String) request.getSession().getAttribute("OverTime");
        int flag = 0;
        if (errorinfo != null && flag==0)
        {
            out.println("<p><font color='red'>" + errorinfo + "</font></p>");
            flag = 1;
        }
        if (overtime != null && flag==0)
        {
            out.println("<p><font color='red'>" + overtime + "</font></p>");
            flag = 1;
        }
    %>
</div>

</body>
</html>
